<% activities.each do |activity| %>
<% topic = Topic.find( activity.id ) %>
  <div class="section">
    <div class="item">
      <h3><%=h topic.title %></h3>
      <div class="type"> 活动帖 </div>
      <div class="description"><%=h topic.topic_content %></div>
      <div class="p">
      	<table width="500" border="0">
  	  <tr>
            <td><img src="images/starter.jpg"/><%=h topic.user.account %></td>
            <td><img src="images/time.jpg"/><%=h topic.created_at %></td>
  	  </tr>
	</table>

      </div>
      <div class="p">
        <table width="240" border="0">
  	  <tr>
    	    <td>
                <% form_remote_tag :url=>{ :controller=>"activity", :action=>"agree", :id=>topic.id, :page=>page } do  %>
                <%= submit_tag " 通过该申请 " %>
                <% end %>
            </td>
    	    <td>
                <% form_remote_tag :url=>{ :controller=>"activity", :action=>"refuse", :id=>topic.id, :page=>page } do  %>
                <%= submit_tag " 拒绝该申请 " %>
                <% end %>
            </td>
          </tr>
        </table>
      </div>
    </div>
  </div>
<%end%>

    <%if page > 1 %>
    <%= link_to_remote "上一页", :url=>{:controller=>"activity", :action=>"last_page", :page=>page } %>
    <%end%>
    <%if activities.count == 5 %>
    <%= link_to_remote "下一页", :url=>{:controller=>"activity", :action=>"next_page", :page=>page } %>
    <%end%>

<% if activities.count == 0 %>
<p style="color: brown">无待评审活动</p>
<% end %>
